import Vue from 'vue'
import VueRouter from 'vue-router'
import HomePage from '../views/home/homePage.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'HomePage',
    component: HomePage,
    redirect: '/home',
    children: [
      {
        path: '/home',//首页
        component: () => import('../views/home/Home.vue')
      },
      {
        path: '/explore',//探索
        component: () => import('../views/explore/Explore.vue'),
        redirect: '/explore',
        children: [
          {
            path: '/explore',//全部
            component: () => import('../views/explore/compontent/all.vue')
          },
          {
            path: '/explore/city',//城市
            component: () => import('../views/explore/compontent/City.vue')
          },
          {
            path: '/explore/creatorworks',//签约摄影师
            component: () => import('../views/explore/compontent/Creatorworks.vue')
          },
          {
            path: '/explore/nature',//自然
            component: () => import('../views/explore/compontent/Nature.vue')
          },
          {
            path: '/explore/people',//人物
            component: () => import('../views/explore/compontent/People.vue')
          },
          {
            path: '/explore/sport',//运动
            component: () => import('../views/explore/compontent/Sport.vue')
          },
        ]
      },
      {
        path: '/label',//标签
        component: () => import('../views/label/Label.vue'),
        redirect: '/label',
        children: [
          {
            path: '/label',//全部
            component: () => import('../views/label/Label.vue')
          },
          {
            path: '/label/groupregion',//城市
            component: () => import('../views/label/compontent/Groupregion.vue')
          },
          {
            path: '/label/groupstyle',//签约摄影师
            component: () => import('../views/label/compontent/Groupstyle.vue')
          },
          {
            path: '/label/groupequipment',//自然
            component: () => import('../views/label/compontent/Groupequipment.vue')
          },
        ]
      },
      {
        path: '/moreDetail',//标签
        component: () => import('../views/label/compontent/moreDetail.vue'),
        // redirect: '/label',
      },
      {
        path: '/photographer',//摄影师
        component: () => import('../views/photographer/Photographer.vue'),
        redirect: '/photographer',
        children: [
          {
            path: '/photographer',//推荐摄影师
            component: () => import('../views/photographer/Photographer.vue')
          },
          {
            path: '/photographer/hot',//热门摄影师
            component: () => import('../views/photographer/component/Hot.vue')
          },
          {
            path: '/photographer/new',//新晋摄影师
            component: () => import('../views/photographer/component/New.vue')
          },
          {
            path: '/photographer/creator',//热门摄影师
            component: () => import('../views/photographer/component/Creator.vue')
          },
        ],
      },
      {
        path: '/creators',//签约摄影师招募
        component: () => import('../views/creators/Creators.vue'),
        redirect: '/creators',
        children: [
          {
            path: '/creators',//签约摄影师招募
            component: () => import('../views/creators/compontents/creator/index.vue')
          },

          {
            path: '/creators/applyNow',//立即申请
            component: () => import('../views/creators/compontents/applyNow/index.vue')
          },
        ],
      },
      {
        path: '/skycity',//天空之城
        component: () => import('../views/skycity/Skycity.vue')
      },
      //用户中心
      {
        path: '/personPage',
        name: 'PersonPage',
        component: () => import('../views/personPage/PersonPage.vue')
      },
    ],
  },

  //注册
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/register/Register.vue')
  },
  //登录
  {
    path: '/logon',
    name: 'Logon',
    component: () => import('../views/logon/Logon.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
